/**
 * Copyright &copy; 2012-2015 <a href="https://github.com/thinkgem/jeesite">JeeSite</a> All rights reserved.
 */
package com.zouqone.smc.modules.sys.utils;

import java.util.List;

import com.google.common.collect.Lists;
import com.zouqone.smc.common.utils.SpringContextHolder;
import com.zouqone.smc.common.utils.vo.ValiterMessage;

import com.zouqone.smc.modules.sys.entity.Menu;
import com.zouqone.smc.modules.sys.dao.MenuDao;

/**
 * 菜单管理Utils
 * @author zouqh
 * @version 2015-09-08
 */
public class MenuUtils {

	private static MenuDao menuDao = SpringContextHolder.getBean(MenuDao.class);
	
	public static Menu getMenu(String id) {
		return menuDao.get(id);
	}
	
	public static List<Menu> getMenuList() {
		List<Menu> menus = null;
		Menu menu = new Menu();
		menus = menuDao.findList(menu);
		if(menus == null){
			menus = Lists.newArrayList();
		}
		return menus;
	}
	
	/**
	public static Menu getMenuByCode(String code) {
		List<Menu> entitys = null;
		Menu entity = new Menu();
		entity.setCode(code);
		entitys = menuDao.findList(entity);
		return entitys.get(0);
	}
	*/
	
	public static ValiterMessage valiter(Menu entity) {
		// TODO Auto-generated method stub
		ValiterMessage valiterMessage = new ValiterMessage();
		valiterMessage.setStatus(true);
		
		
		return valiterMessage;
	}
}